<template>
    <div class="zong">
<button @click="fun('about')">first</button><button @click="fun('home')">second</button>
<keep-alive exclude="about">

<component :is="Com"></component></keep-alive>
    </div>
  </template>
  
  <script>
    import about from './AboutAt.vue'
    import home from './HomeAt.vue'
  export default {
    data(){
return {
  Com:"about"
}
    },
  components:{
    about,
    home
  },
  methods:{
    fun(demo){
   this.Com=demo
    }
  }
  }
  </script>
  
  <style lang="scss" scoped>
  .zong{
      width: 100%;
    //   height: 200px;
      // background-color: rgb(252, 55, 0);
  }
  </style>